/*
 +----------------------------------------------------------------------
 + Title        : notify
 + Author       : huwl
 + Version      : 1.0.0
 + Initial-Time : 2024-12-11
 + Last-time    : 这个文件最后修改的时间 + 修改人的名称
 + Desc         : 通知接口
 +----------------------------------------------------------------------
*/

import type { EditNotifyParams, NotifyListParams, NotifyListResult, NotifyTotalResult, PublishNotifyParams } from "@/types/notify"
import {http} from '@/utils/httpRequest'


/**
 * 发布,请求方式[POST]
 * 
 * @param PublishNotifyParams data -------------------请求参数
 * @returns any
 * @author huwl
 */
export const reqPublishNotifyAPI = (data: PublishNotifyParams) => {
    return http({
        method: 'POST',
        url: 'notify/publish',
        data
    })
}

/**
 * 删除,请求方式[GET]
 * 
 * @param string ids ---------------------------------请求参数
 * @returns any
 * @author huwl
 */
export const reqDeleteNotifyAPI = (ids: string) => {
    return http({
        method: 'GET',
        url: 'notify/delete',
        data: {ids}
    })
}

/**
 * 编辑,请求方式[GET]
 * 
 * @param EditNotifyParams data ----------------------请求参数
 * @returns any
 * @author huwl
 */
export const reqEditNotifyAPI = (data: EditNotifyParams) => {
    return http({
        method: 'POST',
        url: 'notify/edit',
        data
    })
}

/**
 * 详情,请求方式[GET]
 * 
 * @param number id ----------------------------------请求参数
 * @returns any
 * @author huwl
 */
export const reqNotifyDetailAPI = (id: number) => {
    return http({
        method: 'GET',
        url: 'notify/detail',
        data: {id}
    })
}

/**
 * 列表,请求方式[GET]
 * 
 * @param NotifyListParams data ----------------------请求参数
 * @returns NotifyListResult
 * @author huwl
 */
export const reqNotifyListAPI = (data: NotifyListParams) => {
    return http<NotifyListResult>({
        method: 'GET',
        url: 'notify/list',
        data
    })
}

/**
 * 数量,请求方式[GET]
 * 
 * @param NotifyListParams data ----------------------请求参数
 * @returns NotifyTotalResult
 * @author huwl
 */
export const reqNotifyTotalAPI = (data: NotifyListParams) => {
    return http<NotifyTotalResult>({
        method: 'GET',
        url: 'notify/total',
        data
    })
}